/**
 * Created by ZFL on 2017/11/24.
 */
/**
 * Created by ZFL on 2017/11/12.
 */
var userId=$.getPara('userId');
var pageNum=1;
var pageSize=10;
var vm=new Vue({
    el:'#myStores',
    data:{
        storeList:[],
        link:'' ,  //a链接,
        userId:$.getPara('userId')
    },
    methods:{
        pageJump:function(val){
            console.log(val.status)
            if(val.status==4){
                window.location.href='storeRecruit.html?storeId='+val.storeId;
            }else{
                window.location.href='storeInfo.html?storeId='+val.storeId+'&status='+val.status+''+'&userId='+userId;
            }
        }
    }
})
function appInit(){
    PageInit();
}
function PageInit(){
    getstoreList()
}


//function pageJump(val){
//    if(val.staus==4){
//        window.location.href='storeRecruit.html?storeId='+val.storeId;
//    }else{
//        window.location.href='storeInfo.html?storeId='+val.storeId+'&status='+val.status;
//    }
//}

function getstoreList(){
    $.ajaxHandler({
        model:function(){
            var obj={};
            obj.userId=userId;
            obj.pageNum=pageNum;
            obj.pageSize=pageSize;
            return obj;
        },
        visibleTime: 0,
        dataType: "json",
        approve:true,
        api: 'yg_baijiaappgoods/store/myStoreRecList',
        success:function(res){
            if(res.code==10000){
                var data=res.data;
                vm.storeList=data;


            }
        }
    })
}

$('.recruitBtn').click(function(){
    window.location.href='storeRecruit.html'
})